package com.example.apidocserver.infrastructure.util.entity;

import com.example.apidocserver.domain.document.entity.ApiParam;
import com.example.apidocserver.infrastructure.constants.SystemConstants;

import java.util.Objects;

/**
 * 接口参数说明工具
 *
 * @author xyqlg
 */
public class ApiParamDescUtil {
    /**
     * 标准化参数说明
     * @param paramDescVo 参数说明
     */
    public static void standardize(ApiParam paramDescVo) {
        if (Objects.isNull(paramDescVo.getEnableFlag())) {
            paramDescVo.setEnableFlag(SystemConstants.YES);
        }
        if (Objects.isNull(paramDescVo.getParamDesc())) {
            paramDescVo.setParamDesc("");
        }
        if (Objects.isNull(paramDescVo.getParamLevel())) {
            paramDescVo.setParamLevel(SystemConstants.YES);
        }
        if (Objects.isNull(paramDescVo.getParamPath())) {
            paramDescVo.setParamPath("");
        }
    }
}
